
import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import fire from '@dfeidao/atom-web/msg/fire';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
export default async function a002(fd: IFeidaoAiBrowserComponent) {
	console.log('123');
	const d = fd.data.node.querySelectorAll<HTMLInputElement>('[data-id="check"]:checked');
	const dd = fd.data.node.querySelector<HTMLDivElement>('[data-id="query"]');

	console.log(d.length);


	if (!d.length) {
		alert('请选择培训对象');
	} else {
		set_node_cls(dd, 'display-n', true);
	}
	const checkboxs = fd.data.node.querySelectorAll("[data-id='check']");
	const checkid = [];
	const checkname = [];
	for (let i = 0; i < checkboxs.length; i++) {
		const checkbox = checkboxs.item(i) as HTMLInputElement;
		if (checkbox.checked) {
			checkid.push(checkbox.getAttribute('data-no'));
			checkname.push(checkbox.getAttribute("data-temp"));
		}
	}
	if (checkid.length <= 0) {
		alert("请选择数据");
		return;
	}

	const ids = checkid as string[];
	const names = checkname as string[];
	fire('zj-000003', 'a003', ids, names);
	// set(fd, 'id1', id1);
}

	// import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';

	// import set from '@dfeidao/atom-web/local/set';
	// export default async function a004(fd: IFeidaoAiBrowserComponent) {
	//     // todo
	//     const checkboxs = fd.data.node.querySelectorAll("[data-id='checkbox']");

	//     const check = [];
	//     for (let i = 0; i < checkboxs.length; i++) {
	//         const checkbox = checkboxs.item(i) as HTMLInputElement;
	//         if (checkbox.checked) {
	//             check.push(checkbox.getAttribute("data-temp"));
	//         }
	//     }
	//     if (check.length <= 0) {
	//         alert("请选择数据");
	//         return;
	//     }
	//     console.log("KKKKKKKKKKKKKKKK11111=>", check);
	//     const id1 = check as string[];

	//     set(fd, 'id1', id1);
	// }


